<!DOCTYPE html>

<html lang="en">
<head>
	<meta charset="utf-8">
	<title>nodeframe Class: AuthModule</title>

	<!--[if lt IE 9]>
	<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
	<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">

	<link type="text/css" rel="stylesheet" href="styles/site.cerulean.css">

</head>

<body>
<div class="container-fluid">
	<div class="navbar navbar-fixed-top navbar-inverse">
		<div class="navbar-inner">
			<a class="brand" href="index.html">nodeframe</a>
			<ul class="nav">
				
				<li class="dropdown">
					<a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b
						class="caret"></b></a>

					<ul class="dropdown-menu ">
						
						<li>
							<a href="module-Helpers.html">Helpers</a>
						</li>
						
						<li>
							<a href="module-HttpCode.html">HttpCode</a>
						</li>
						
						<li>
							<a href="module-Nodeframe.html">Nodeframe</a>
						</li>
						
						<li>
							<a href="module-Pattern.html">Pattern</a>
						</li>
						

					</ul>
				</li>
				
				<li class="dropdown">
					<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
						class="caret"></b></a>

					<ul class="dropdown-menu ">
						
						<li>
							<a href="App.html">App</a>
						</li>
						
						<li>
							<a href="AuthModule.html">AuthModule</a>
						</li>
						
						<li>
							<a href="MvcRouter.html">MvcRouter</a>
						</li>
						
						<li>
							<a href="Router.html">Router</a>
						</li>
						
						<li>
							<a href="RouterWithView.html">RouterWithView</a>
						</li>
						
						<li>
							<a href="WebModule.html">WebModule</a>
						</li>
						

					</ul>
				</li>
				
				<li class="dropdown">
					<a href="mixins.list.html" class="dropdown-toggle" data-toggle="dropdown">Mixins<b
						class="caret"></b></a>

					<ul class="dropdown-menu ">
						
						<li>
							<a href="Common.html">Common</a>
						</li>
						
						<li>
							<a href="Misc.html">Misc</a>
						</li>
						

					</ul>
				</li>
				
				<li class="dropdown">
					<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
						class="caret"></b></a>

					<ul class="dropdown-menu ">
						
						<li>
							<a href="global.html#_">_</a>
						</li>
						
						<li>
							<a href="global.html#ArgumentError">ArgumentError</a>
						</li>
						
						<li>
							<a href="global.html#async">async</a>
						</li>
						
						<li>
							<a href="global.html#Base">Base</a>
						</li>
						
						<li>
							<a href="global.html#bootstrap">bootstrap</a>
						</li>
						
						<li>
							<a href="global.html#ConfigError">ConfigError</a>
						</li>
						
						<li>
							<a href="global.html#DbOperationError">DbOperationError</a>
						</li>
						
						<li>
							<a href="global.html#fs">fs</a>
						</li>
						
						<li>
							<a href="global.html#H">H</a>
						</li>
						
						<li>
							<a href="global.html#HttpCode">HttpCode</a>
						</li>
						
						<li>
							<a href="global.html#NotFoundError">NotFoundError</a>
						</li>
						
						<li>
							<a href="global.html#Pattern">Pattern</a>
						</li>
						
						<li>
							<a href="global.html#RuleRouter">RuleRouter</a>
						</li>
						
						<li>
							<a href="global.html#S">S</a>
						</li>
						
						<li>
							<a href="global.html#SystemDesignError">SystemDesignError</a>
						</li>
						
						<li>
							<a href="global.html#UsageError">UsageError</a>
						</li>
						

					</ul>
				</li>
				
			</ul>
		</div>
	</div>

	<div class="row-fluid">

		
		<div class="span8">
			
				<div id="main">
					


	<h1 class="page-title">Class: AuthModule</h1>
<section>

<header>
    <h2>
    AuthModule
    </h2>
    
</header>

<article>
    <div class="container-overview">
    

    
        
<dt>
    <h4 class="name" id="AuthModule"><span class="type-signature"></span>new AuthModule<span class="signature">(router, runtime)</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        <p>The base class of auth module</p>
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
	<tr>
		
		<th>Name</th>
		

		<th>Type</th>

		

		

		<th class="last">Description</th>
	</tr>
	</thead>

	<tbody>
	

        <tr>
            
                <td class="name"><code>router</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Router.html">Router</a></span>


            
            </td>

            

            

            <td class="description last"><p>Router object</p></td>
        </tr>

	

        <tr>
            
                <td class="name"><code>runtime</code></td>
            

            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>

            

            

            <td class="description last"><p>Runtime information</p></td>
        </tr>

	
	</tbody>
</table>

    
    
    
<dl class="details">
	

	

	

	

	

	

	

	

	



	
	<dt class="tag-source">Source:</dt>
	<dd class="tag-source">
		lib/nodeauth.js
	</dd>
	

	

	

	
</dl>

    
    

    

    
    
    
    
    
    
    
</dd>

    
    </div>

    

    

    

    

    

    

    
        <h3 class="subsection-title">Methods</h3>

        <dl>
            
<dt>
    <h4 class="name" id="data"><span class="type-signature"></span>data<span class="signature">(<span class="optional">path</span>)</span><span class="type-signature"> &rarr; {*}</span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        <p>Get auth data by dot-path</p>
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
	<tr>
		
		<th>Name</th>
		

		<th>Type</th>

		
		<th>Argument</th>
		

		

		<th class="last">Description</th>
	</tr>
	</thead>

	<tbody>
	

        <tr>
            
                <td class="name"><code>path</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"></td>
        </tr>

	
	</tbody>
</table>

    
    
    
<dl class="details">
	

	

	

	

	

	

	

	

	



	
	<dt class="tag-source">Source:</dt>
	<dd class="tag-source">
		lib/nodeauth.js
	</dd>
	

	

	

	
</dl>

    
    

    

    
    
    
    
    
    <h5>Returns:</h5>
    
            


<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">*</span>


	</dd>
</dl>


        
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="init"><span class="type-signature"></span>init<span class="signature">(callback)</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        <p>Init auth module</p>
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
	<tr>
		
		<th>Name</th>
		

		<th>Type</th>

		

		

		<th class="last">Description</th>
	</tr>
	</thead>

	<tbody>
	

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html#completionCallback">completionCallback</a></span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

	
	</tbody>
</table>

    
    
    
<dl class="details">
	

	

	

	

	

	

	

	

	



	
	<dt class="tag-source">Source:</dt>
	<dd class="tag-source">
		lib/nodeauth.js
	</dd>
	

	

	

	
</dl>

    
    

    

    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="signIn"><span class="type-signature"></span>signIn<span class="signature">(user, <span class="optional">extra</span>, callback)</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        <p>Sign in</p>
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
	<tr>
		
		<th>Name</th>
		

		<th>Type</th>

		
		<th>Argument</th>
		

		

		<th class="last">Description</th>
	</tr>
	</thead>

	<tbody>
	

        <tr>
            
                <td class="name"><code>user</code></td>
            

            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>User profile</p></td>
        </tr>

	

        <tr>
            
                <td class="name"><code>extra</code></td>
            

            <td class="type">
            
                
<span class="param-type">*</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Extra auth data</p></td>
        </tr>

	

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html#completionCallback">completionCallback</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"></td>
        </tr>

	
	</tbody>
</table>

    
    
    
<dl class="details">
	

	

	

	

	

	

	

	

	



	
	<dt class="tag-source">Source:</dt>
	<dd class="tag-source">
		lib/nodeauth.js
	</dd>
	

	

	

	
</dl>

    
    

    

    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="signOut"><span class="type-signature"></span>signOut<span class="signature">(callback)</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        <p>Sign out</p>
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
	<tr>
		
		<th>Name</th>
		

		<th>Type</th>

		

		

		<th class="last">Description</th>
	</tr>
	</thead>

	<tbody>
	

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html#completionCallback">completionCallback</a></span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

	
	</tbody>
</table>

    
    
    
<dl class="details">
	

	

	

	

	

	

	

	

	



	
	<dt class="tag-source">Source:</dt>
	<dd class="tag-source">
		lib/nodeauth.js
	</dd>
	

	

	

	
</dl>

    
    

    

    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="uid"><span class="type-signature"></span>uid<span class="signature">()</span><span class="type-signature"> &rarr; {*}</span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        <p>Get user id</p>
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
	

	

	

	

	

	

	

	

	



	
	<dt class="tag-source">Source:</dt>
	<dd class="tag-source">
		lib/nodeauth.js
	</dd>
	

	

	

	
</dl>

    
    

    

    
    
    
    
    
    <h5>Returns:</h5>
    
            


<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">*</span>


	</dd>
</dl>


        
    
    
</dd>

        </dl>
    

    

    
</article>

</section>




				</div>

				<div class="clearfix"></div>
				<footer>
					
					
		<span class="copyright">
		MIT License. Copyright © 2013-2014 <a href="http://www.kitmi.com.au">KIT Mobile Internet</a>.
		</span>
					<br />
					
		<span class="jsdoc-message">
		Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha13</a>
		on 2015-01-08T23:51:33+08:00 using the <a
			href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
		</span>
				</footer>
			</div>

			
			<div class="span3">
				<div id="toc"></div>
			</div>
			
			<br clear="both">
		</div>

	</div>
	<!--<script src="scripts/sunlight.js"></script>-->
	<script src="scripts/docstrap.lib.js"></script>
	<script src="scripts/bootstrap-dropdown.js"></script>
	<script src="scripts/toc.js"></script>

	<script>
		$( function () {
			$( "[id*='$']" ).each( function () {
				var $this = $( this );

				$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
			} );

			$( "#toc" ).toc( {
				anchorName  : function ( i, heading, prefix ) {
					return $( heading ).attr( "id" ) || ( prefix + i );
				},
				selectors   : "h1,h2,h3,h4",
				showAndHide : false,
				scrollTo    : "100px"
			} );

			$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
			$( "#main span[id^='toc']" ).addClass( "toc-shim" );
			$( '.dropdown-toggle' ).dropdown();
//			$( ".tutorial-section pre, .readme-section pre" ).addClass( "sunlight-highlight-javascript" ).addClass( "linenums" );

			$( ".tutorial-section pre, .readme-section pre" ).each( function () {
				var $this = $( this );

				var example = $this.find( "code" );
				exampleText = example.html();
				var lang = /{@lang (.*?)}/.exec( exampleText );
				if ( lang && lang[1] ) {
					exampleText = exampleText.replace( lang[0], "" );
					example.html( exampleText );
					lang = lang[1];
				} else {
					lang = "javascript";
				}

				if ( lang ) {

					$this
						.addClass( "sunlight-highlight-" + lang )
						.addClass( "linenums" )
						.html( example.html() );

				}
			} );

			Sunlight.highlightAll( {
				lineNumbers : true,
				showMenu : true,
				enableDoclinks : true
			} );
		} );
	 </script>



	<!--Navigation and Symbol Display-->
	


	<!--Google Analytics-->
	

</body>
</html>